//
//  VertificateViewController.m
//  02-LaGouRegisterHomeWork
//
//  Created by 曹曹 on 16/7/16.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import "VertificateViewController.h"
#import "LoginView.h"

#define SCREEN_WIDTH self.view.frame.size.width

@interface VertificateViewController ()
@property (nonatomic, strong) UIImageView *backgroundImageView;
@end

@implementation VertificateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.view.frame = [UIScreen mainScreen].bounds;
//    [self createBackButton];
    [self createLabel];
    LoginView *vertificateView = [[LoginView alloc] initWithFrame:CGRectMake(14, 180, SCREEN_WIDTH - 28, 89)
                                                        imageUser:@"phone"
                                                    imagePassword:@"vertification"
                                                  placeHolderUser:@"手机号(仅支持中国大陆手机)"
                                          placeHolderDownPassword:@"验证码"];
    [self.view addSubview:vertificateView];
    [self createNextButton];
    [self createProtocalView];
}
#pragma mark - 下一步按钮
- (void)createNextButton {
    UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [nextButton setTitle:@"下一步" forState:UIControlStateNormal];
    [nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.view addSubview:nextButton];
    nextButton.backgroundColor = [UIColor colorWithRed:0.01 green:0.81 blue:0.53 alpha:1.00];
    nextButton.frame = CGRectMake(14, 300, SCREEN_WIDTH - 28, 44);
    nextButton.layer.cornerRadius = 5;
}
#pragma mark - 返回按钮
- (void)createBackButton {
    UIButton *backButtn = [UIButton buttonWithType:UIButtonTypeSystem];
    backButtn.frame = CGRectMake(14, 44, 60, 30);
    [backButtn setImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [self.view addSubview:backButtn];
    [backButtn addTarget:self action:@selector(handleBack:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)createProtocalView {
    UIView *protocalView = [[UIView alloc] initWithFrame:CGRectMake(30, 360, 225, 30)];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 165, 30)];
    label.text = @"邮箱用户找回密码, 请";
    label.textColor = [UIColor grayColor];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(165, 0, 60, 30);
    [button setTitle:@"点击这里" forState:UIControlStateNormal];
    button.titleLabel.textAlignment = NSTextAlignmentLeft;
    [button setTitleColor:[UIColor colorWithRed:0.00 green:0.67 blue:0.53 alpha:1.00] forState:UIControlStateNormal];
    [protocalView addSubview:label];
    [protocalView addSubview:button];
    [self.view addSubview:protocalView];
}
- (void)createLabel {
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - 100) / 2, 100, 100, 40)];
    label.text = @"验证手机";
    label.textColor = [UIColor colorWithRed:0.01 green:0.81 blue:0.53 alpha:1.00];
    [self.view addSubview:label];
}
#pragma mark - 返回按钮点击事件
- (void)handleBack:(UIButton *)button {
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
